import React, { useState, useEffect } from 'react'
import './index.css'
import userimg from '../../../static/img/MyCenter/user.png'
import ggimg from '../../../static/img/MyCenter/gg.png'
import { Link } from 'react-router-dom'
import axios from 'axios'
import { aUrl } from '../../../static/axios_url'
export default function Myaccount() {
    const [account, setaccount] = useState({})
    useEffect(() => {
        axios.post(aUrl + '/mycenter/myAccount', { id: 1 }).then((res) => {
            console.log(res.data);
            setaccount(res.data)
        })
    }, [])
    return (
        <div>
            <div className="usermes">
                <img src={userimg} alt="" />
                <span className='username'>你好 , <strong>{account.ni_name}</strong></span>
                <div className='userright'>
                    <div>
                        <span>当前积分</span>
                        <span>我的钱包</span>
                        <Link to='topup' >{'充值有礼>>'}</Link>
                    </div>
                    <div>
                        <span>{account.jf}</span>
                        <span>{account.wallet}</span>
                        <Link to={'/mycenter/myaccount'}>{'充值卡兑换>>'}</Link>
                    </div>
                </div>
            </div>
            <div className='gg'>
                <img src={ggimg} alt="" />
            </div>
        </div>
    )
}
